<template>
  <div>
    <ul>
      <li v-for="i in goodsList" :key="i.id" @click="goTodetail(i.id)">
        <img :src="i.list_pic_url" alt />
        <!-- 标题 -->
        <div class="title van-ellipsis">{{i.name}}</div>
        <div class="price">{{i.retail_price | filterMoney}}</div>
      </li>
    </ul>
  </div>
</template>

<script>
export default {
  props: ['goodsList'],
  data () {
    return {

    }
  },
  methods: {
    goTodetail (id) {
      this.$router.push({
        path: '/productdetail',
        query: { id: id }
      })
    }
  }
}
</script>

<style lang="less" scoped>
ul {
  padding: 0.1rem 2%;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  text-align: center;
  background-color: #efefef;
  li {
    width: 49%;
    background-color: #fff;
    line-height: 0.3rem;
    margin-bottom: 0.1rem;
    img {
      width: 100%;
      display: block;
    }
    .price {
      color: darkred;
    }
  }
}
</style>
